home *** CD-ROM | disk | FTP | other *** search
- #ifndef __APPHEADER__
- #define __APPHEADER__
-
- #ifndef __DTSLib__
- #include "DTS.Lib.h"
- #endif
-
- #ifndef __PRINTING__
- #include <Printing.h>
- #endif
-
- #ifndef __TREEOBJ__
- #include <TreeObj.h>
- #endif
-
- /********/
-
- #define VH_VERSION 1 /* True means to include ViewHierarchy window. */
- #define DEV_VERSION 1 /* True means allow option-cmd.period escape from dialogs. */
-
- /* If you are unfamiliar with programming with the DTS.framework, you probably want to
- ** read the file "=How to write your app", which is found at the same level as the
- ** directory for this project. */
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- typedef struct {
- DocHeaderInfo fhInfo; /* Doc header info (version, print record, window loc. ) */
- TreeObjHndl root;
- /***** Start of custom file info. *****/
- } TheDoc;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
- /* Below is the master document structure. All DTS.framework documents use this structure.
- ** For each unique document type, union in a sub-structure for the document-specific
- ** information. In the case of DTS.Chat, there is only one document type. The structure for
- ** this document type is defined just above. Even though there is only one, it is still
- ** placed in a union. This allows easy addition of additional document types later.
- ** Given a FileRec handle called frHndl, a sample dereference to the inBox field would look like:
- ** inBox = (*frHndl)->d.doc.inBox;
- **
- ** The fileState and connect fields are expected and managed by DTS.framework. Also, the
- ** first two fields in the app-specific portion of the document are expected, namely
- ** the fhInfo and root fields. */
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- typedef struct FileRec {
- FileStateRec fileState; /* DTS.Lib expects this structure here. */
- ConnectRec connect; /* DTS.Lib expects this structure here. */
- union {
- TheDoc doc; /* Union in each document type here. */
- } d;
- } FileRec;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
- /* Below is the definition of the hierarchical document's root object. If you are using
- ** the hierarchical document package TreeObj, then you will need at least this object.
- ** TreeObj expects the first two fields to be undo and frHndl, as shown below. You can
- ** add fields after these two fields. If you use TreeObj, the root object and all of its
- ** children are automatically saved and read from disk.
- ** Note that the definition for the root object includes a prototype. Each object is
- ** automatically called by DTS.LIB..framework at appropriate times. The prototype defines the
- ** function that will be called for this object. See the files "=How to write your app"
- ** and "=Using TreeObj.c" for more information. */
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TRootObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- TreeObjHndl undo; /* This structure may be added to, but */
- FileRecHndl frHndl; /* these two first fields must remain. */
- short numSelected;
- } RootObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
- /* This definition allows us to access the fields that are in common between the below objects. */
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- typedef struct {
- Boolean selected;
- Rect rect;
- short penHeight;
- short penWidth;
- RGBColor borderColor;
- Boolean content;
- RGBColor contentColor;
- } CommonObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- /* Below are the definitions of the various DTS.Draw tool palette objects. */
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TRectObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect rect;
- short penHeight;
- short penWidth;
- RGBColor borderColor;
- Boolean content;
- RGBColor contentColor;
- } RectObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TRRectObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect rect;
- short penHeight;
- short penWidth;
- RGBColor borderColor;
- Boolean content;
- RGBColor contentColor;
- short width, height;
- } RRectObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TOvalObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect oval;
- short penHeight;
- short penWidth;
- RGBColor borderColor;
- Boolean content;
- RGBColor contentColor;
- } OvalObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- OSErr CalcPiePoints(TreeObjHndl hndl);
- long TPieObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect arc;
- short penHeight;
- short penWidth;
- RGBColor borderColor;
- Boolean content;
- RGBColor contentColor;
- short arcStart;
- short arcLength;
- Point center;
- Point arcBegin;
- Point arcEnd;
- } PieObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TLineObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect rect;
- short penHeight;
- short penWidth;
- RGBColor borderColor;
- Boolean content;
- RGBColor contentColor;
- short flip;
- } LineObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TGroupObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect group;
- } GroupObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #ifdef powerc
- #pragma options align=mac68k
- #endif
- long TExtSelectObj(TreeObjHndl hndl, short message, long data);
- typedef struct {
- Boolean selected;
- Rect selectArea;
- } ExtSelectObj;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- #define VFLIPOBJ 0x01
- #define HFLIPOBJ 0x02
-
-
- /* Here are some macro definitions to make dereferencing document objects easier. */
-
- #define mDerefRoot(hndl) ((RootObj*)((*hndl) + 1))
- #define mDerefCommon(hndl) ((CommonObj*)((*hndl) + 1))
- #define mDerefRect(hndl) ((RectObj*)((*hndl) + 1))
- #define mDerefRRect(hndl) ((RRectObj*)((*hndl) + 1))
- #define mDerefOval(hndl) ((OvalObj*)((*hndl) + 1))
- #define mDerefPie(hndl) ((PieObj*)((*hndl) + 1))
- #define mDerefLine(hndl) ((LineObj*)((*hndl) + 1))
- #define mDerefGroup(hndl) ((GroupObj*)((*hndl) + 1))
- #define mDerefExtSelect(hndl) ((ExtSelectObj*)((*hndl) + 1))
-
-
- /********/
-
- #define kMaxNumUndos 64
- #define kNumSaveUndos 8
-
- #define RECTOBJ 16
- #define RRECTOBJ 17
- #define OVALOBJ 18
- #define PIEOBJ 19
- #define LINEOBJ 20
- #define GROUPOBJ 65
- #define EXTSELECTOBJ 66
-
- #define kNumTreeObjs 67 /* Minimum number of objects is 16. */
-
-
- /********/
-
- /* These values are passed to the DTS.LIB..framework function Initialize(). */
- #define kMinHeap 64 * 1024 /* Needs at least 64k of heap space. */
- #define kMinSpace 64 * 1024 /* Needs this much after calling PurgeSpace. */
-
-
- #define kwAppWindow (kwGrowIcon | kwHScrollLessGrow | kwVScrollLessGrow | kwVisible | kwOpenAtOldLoc)
-
- #define kVersion 101 /* Document versions, not application versions. */
- #define kMinVersion 100
- #define kMaxVersion 101
-
- #define kMaxNumWindows 65535 /* No limit on the number of windows. */
-
- #endif
-